<template name="putawayMoveDocBySNRFListPage">
	<view>
		<scroll-view scroll-y class="page">
		<cu-custom bgColor="bg-gradual-blue" :isBack="true" backRouterName="putawayMoveDocRFSNInputPage">
			<block slot="content">按SN上架 - 任务</block>
		</cu-custom>
		<view class="cu-bar bg-gradual-blue search">
			<view class="search-form radius">
				<text class="cuIcon-search"></text>
				<input :adjust-position="false"  v-model="searchParam" @input="onInput"  type="text" placeholder="SN码" confirm-type="search" @confirm="search()"></input>
			</view>
		</view>
		<view>
			<view class="cu-list menu-avatar padding-sm">
				<view class="cu-item margin-bottom-sm animation-slide-bottom bg-gradual-blue padding radius text-center shadow-blur" v-for="(item,index) in receiveList" @tap="chooseSnTask(item)">
					<view class="cu-avatar square lg" style="background-image:url(/static/home/128/shangjia.png);">
					</view>
					<view class="content">
						<view class="text-yellow text-bold">[{{item.snCode}}]</view>
						<view class="text-gray text-sm flex">
							<view class="text-cut text-bold">
								<text class="text-white margin-right-xs">[物料编码]：{{item.itemCode}}</text>
							</view> 
						</view>
						<view class="text-gray text-sm flex text-bold">
							<view class="text-cut">
								<text class="text-white margin-right-xs">[物料名称]：{{item.itemName}}</text>
							</view> 
						</view>
					</view>
					<view class="action">
						<view class="cu-tag square bg-gradual-orange sm">{{item.toLocationCode}}</view>
					</view>
				</view>
			</view>
		</view>
		</scroll-view>
	</view>
</template>



<script>
	import crypto from '@/api/crypto.js' 
	export default {
		data() {
			return {
				searchParam:'',
				putAwaySnList:[],
				putAwaySnListUrl:'/pda/initPutAwaySnList'
			}
		},
		onLoad:function(){
			this.initPutAwaySnList();
		},
		methods: {
			initPutAwaySnList(){
				this.$http.get(this.putAwaySnListUrl,{params:{warehouseId:crypto.encrypt(this.$store.getters.warehouseid),searchParam:crypto.encrypt(this.searchParam),workerId:crypto.encrypt(this.$store.getters.userid)}}).then(res=>{
				  if(res.data.success){
					  this.putAwaySnList = res.data.result;
				  }else{
					 this.$tip.error(res.data.message);
				  }
				}).catch(()=>{
					this.$tip.loaded();
				});
			},
			onInput(e){
				this.searchParam = e.target.value
			},
			chooseSnTask(item){
				uni.navigateTo({
					url: '/pages/wms/putawayMoveDocRFSNLocationInputPage?item='+ encodeURIComponent(JSON.stringify(item))
				});
			},
			search(){
				this.initPutAwaySnList();
			}
		}
	}
</script>

<style>
</style>